<html>
<body>

Example demonstrating a violation of Liskov Substitution Principle (LSP). When replacing EvenNumberChecker with its subclass SafeEvenNumberChecker, LSP is 
violated twice: 

<ol>
<li>The method isEvenNumber(int) expects non-negative numbers and has therefore stricter preconditions (than the overridden method)</li>
<li>The method isEvenNumber(int) can throw a runtime exception and has therefore weaker postconditions (than the overridden method) - it cannot guarantee that no exception is thrown</li>
</ol>

Execute RunExample to run this scenario. 
<p/>
&copy; Jens Dietrich, 2012

</body>
</html>